<!--{if !$iscircle || !$sgid}-->{template header}<!--{else}-->{template supesite_header}<!--{/if}-->

<div id="nav"><a href="$indexname">$bbname</a> $navigation &raquo;
	<!--{if $special == 1}-->{lang post_newthread_poll}
	<!--{elseif $special == 3}-->{lang post_newthread_reward}
	<!--{elseif $special == 5}-->{lang post_newthread_debate}
	<!--{else}-->{lang post_newthread}<!--{/if}--></div>

<!--{if $special == 4 || $special == 5}-->
	<script type="text/javascript" src="include/javascript/calendar.js"></script>
<!--{/if}-->
<script type="text/javascript">
var postminchars = parseInt('$minpostsize');
var postmaxchars = parseInt('$maxpostsize');
var disablepostctrl = parseInt('$disablepostctrl');
var typerequired = parseInt('$forum[threadtypes][required]');
var bbinsert = parseInt('$bbinsert');//显示 Discuz! 代码辅助工具
var seccodecheck = parseInt('$seccodecheck');
var secqaacheck = parseInt('$secqaacheck');
var special = parseInt('$special');
var isfirstpost = 1;
var allowposttrade = parseInt('$allowposttrade');
var allowpostreward = parseInt('$allowpostreward');
var allowpostactivity = parseInt('$allowpostactivity');
lang['board_allowed'] = '{lang board_allowed}';
lang['lento'] = '{lang lento}';
lang['bytes'] = '{lang bytes}';
lang['post_curlength'] = '{lang post_curlength}';
lang['post_subject_and_message_isnull'] = '{lang post_subject_and_message_isnull}';
lang['post_subject_toolong'] = '{lang post_subject_toolong}';
lang['post_message_length_invalid'] = '{lang post_message_length_invalid}';
lang['post_type_isnull'] = '{lang post_type_isnull}';
lang['post_reward_credits_null'] = '{lang post_reward_credits_null}';
</script>

{template post_preview}

<form method="post" id="postform" action="post.php?action=newthread&fid=$fid&extra=$extra&topicsubmit=yes" $enctype>
	<input type="hidden" name="formhash" id="formhash" value="{FORMHASH}" />
	<input type="hidden" name="isblog" value="$isblog" />
	<input type="hidden" name="frombbs" value="1" />
	<!--{if $special}-->
		<input type="hidden" name="special" value="$special" />
	<!--{/if}-->

	<div class="mainbox formbox">
		<span class="headactions"><a class="notabs" href="member.php?action=credits&view=forum_post&fid=$fid" target="_blank">{lang credits_policy_view}</a></span>
		<h1><!--{if $special == 1}-->{lang post_newthread_poll}<!--{elseif $special == 3}-->{lang post_newthread_reward}
			<!--{elseif $special == 5}-->{lang post_newthread_debate}<!--{else}-->{lang post_newthread}<!--{/if}--></h1>
		<table summary="post" cellspacing="0" cellpadding="0" id="newpost">
			<thead>
				<tr>
					<th>{lang username}</th>
					<td>
						<!--{if $discuz_uid}-->
							$discuz_userss [<a href="$link_logout">{lang member_logout}</a>]
						<!--{else}-->
							{lang guest} [<a href="$link_login">{lang member_login}</a>]
						<!--{/if}-->
					</td>
				</tr>
			</thead>

		<!--{if $seccodecheck}-->
			<tr>
				<th><label for="seccodeverify">{lang seccode}</label></th>
				<td>
					<div id="seccodeimage"></div>
					<input type="text" onfocus="updateseccode();this.onfocus = null" id="seccodeverify" name="seccodeverify" size="8" maxlength="4" tabindex="0" />
					<em class="tips"><strong>{lang seccode_click}</strong> <!--{if $seccodedata['type'] == 2}-->{lang seccode_animator_flashrefresh}<!--{elseif $seccodedata['animator'] == 1}-->{lang seccode_animator_refresh}<!--{else}-->{lang seccode_refresh}<!--{/if}--></em></td>
					<script type="text/javascript">
						var seccodedata = [{$seccodedata['width']}, {$seccodedata['height']}, {$seccodedata['type']}];
					</script>
			</tr>
		<!--{/if}-->

		<!--{if $secqaacheck}-->
			<tr><th><label for="secanswer">{lang secqaa}</label></th>
			<td><div id="secquestion"></div><input type="text" name="secanswer" id="secanswer" size="25" maxlength="50" tabindex="1" />
			<script type="text/javascript">ajaxget('ajax.php?action=updatesecqaa', 'secquestion');</script></td>
			</tr>
		<!--{/if}-->

		<!--{if $special == 3 && $allowpostreward}-->
			<tr>
				<th>{lang reward_price}<!--{if !empty($extcredits[$creditstrans][title])}-->({$extcredits[$creditstrans][title]})<!--{/if}--></th>
				<td><input onkeyup="getrealprice(this.value)" type="text" name="rewardprice" size="6" value="$minrewardprice" tabindex="2" /> <em class="tips">
			{lang reward_tax_after}: <span id="realprice">0</span>  {$extcredits[$creditstrans][unit]} ({lang reward_low} $minrewardprice {$extcredits[$creditstrans][unit]}
					<!--{if $maxrewardprice > 0}--> - $maxrewardprice {$extcredits[$creditstrans][unit]}<!--{/if}--></em>)
			</td>
			</tr>
			<script type="text/javascript">
				$('realprice').innerHTML = parseInt($('postform').rewardprice.value) + parseInt(Math.ceil( $('postform').rewardprice.value * $creditstax ));
				function getrealprice(price){
					if(!price.search(/^\d+$/) ) {
						n = Math.ceil(parseInt(price) + price * $creditstax);
						if(price > 32767) {
							$('realprice').innerHTML = '<b>{lang reward_price_overflow}</b>';
						} else if(price < $minrewardprice || ($maxrewardprice > 0 && price > $maxrewardprice)) {
							$('realprice').innerHTML = '<b>{lang reward_price_bound}</b>';
						} else {
							$('realprice').innerHTML = n;
						}
					}else{
						$('realprice').innerHTML = '<b>{lang input_invalid}</b>';
					}
				}
			</script>
		<!--{/if}-->

		<tr>
			<th style="border-bottom: 0"><label for="subject">{lang subject}</label></th>
			<td style="border-bottom: 0">
				<!--{if $iscircle && $mycircles}-->
					<select name='sgid'>
						<option value="0">{lang circle_select_please}</option>
						<!--{loop $mycircles $id $name}-->
						<option value="$id">$name</option>
						<!--{/loop}-->
					</select>
				<!--{else}-->
					$typeselect
				<!--{/if}-->
				<input type="text" name="subject" id="subject" size="45" value="$subject" tabindex="3" />

			</td>
		</tr>

		<tbody id="threadtypes"></tbody>

		<!--{if $special == 6 && $allowpostvideo}-->
			<tr>
				<th style="border-bottom: 0" valign="top">
					<label for="uploaddiv"><input type="radio" name="visup" value="1" checked="checked" onclick="$('uploaddiv').innerHTML = getVideoPlayer(0)">{lang video_upload}</label><br />
					<label for="recorddiv"><input type="radio" name="visup" value="0" onclick="$('uploaddiv').innerHTML = getVideoPlayer(1)">{lang video_record}</label>
					</th>
				<td style="border-bottom: 0">
					<div id="uploaddiv"></div>
					<input type="checkbox" name="vautoplay" value="1">{lang video_auto}
					<input type="checkbox" name="vshare" value="1" checked>{lang video_share}
					 <br /><em>{lang video_limit_size}: 100M</em>
					 <br /><em>{lang video_format_supported}: .flv .mpg .m4v .mpeg .mpe .vod .wmv .wm .rm .rmvb .avi .asx .ra .ram .asf .3gp .mov .mp4</em>
					<input type="hidden" name="vid" id="vid" />
					<input type="hidden" name="subjectu8" id="subjectu8">
					<input type="hidden" name="tagsu8" id="tagsu8">
					{eval $vcode = urlencode(authcode('siteurl='.$boardurl.'&uid='.$discuz_uid, 'ENCODE', "$vkey"));}

					<script type="text/javascript">
					function setVideoInfo(vid) {
						$('vid').value = vid;
					}
					function getVideoPlayer(isup) {
						if(!isup) {
							var s = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="351" height="30" title="aa" id="vidPlayer">';
							s += '<param name="movie" value=\'http://union.bokecc.com/flash/discuz2/VideoDuke.swf?siteid=$vsiteid&code=$vcode\'/>';
							s += '<param name="quality" value="high" />';
							s += '<param name="allowScriptAccess" value="always" />';
							s += '<param name="allownetworking" value="all" />';
							s += '<embed src=\'http://union.bokecc.com/flash/discuz2/VideoDuke.swf?siteid=$vsiteid&code=$vcode\' quality="high" allowScriptAccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="351" height="30"></embed>';
							s += '</object>';
						} else {
							var s = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="351" height="237" title="aa" id="vidPlayer">';
							s += '<param name="movie" value=\'http://union.bokecc.com/flash/discuz2/VideoRecord.swf?siteid=$vsiteid&code=$vcode\'/>';
							s += '<param name="quality" value="high" />';
							s += '<param name="allowScriptAccess" value="always" />';
							s += '<param name="allownetworking" value="all" />';
							s += '<embed src=\'http://union.bokecc.com/flash/discuz2/VideoRecord.swf?siteid=$vsiteid&code=$vcode\' quality="high" allowScriptAccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="351" height="237"></embed>';
							s += '</object>';
						}
						return s;
					}
					$('uploaddiv').innerHTML = getVideoPlayer(0);
					</script>
				</td>
			</tr>
			<tr>
				<th style="border-bottom: 0" valign="top">{lang video_type}</th>
				<td style="border-bottom: 0" valign="top">$vclassesselect</td>
			</tr>
		<!--{/if}-->

		<!--{if $special == 1 && $allowpostpoll}-->
			<tr>
				<th><label for="expiration">{lang poll_days_valid}</label></th>
				<td><input type="text" name="expiration" id="expiration" value="0" size="6" tabindex="4" /><em class="tips">({lang post_zero_is_nopermission})</em></td>
			</tr>
			<tr>
			<th valign="top">{lang post_poll_options}<br />
			{lang post_poll_comment}<br /><br />
			<input type="checkbox" name="visiblepoll" value="1" /> {lang poll_submit_after}<br />
			<input type="checkbox" name="multiplepoll" value="1" onclick="this.checked?$('maxchoicescontrol').style.display='':$('maxchoicescontrol').style.display='none';" />
				{lang post_poll_allowmultiple}<br />
			<span id="maxchoicescontrol" style="display: none">{lang poll_max_options}: <input type="text" name="maxchoices" value="$maxpolloptions" size="5"><br /></span>
			</th><td>
			<textarea rows="8" name="polloptions" style="width: 600px; word-break: break-all" tabindex="5">$polloptions</textarea></td>
			</tr>
		<!--{/if}-->

		<tr>
			{template post_editor}
		</tr>

		<!--{if $tagstatus}-->
			<tr>
				<th><label for="tags">{lang post_tag}</label></th>
				<td>
					<input size="45" type="input" id="tags" name="tags" value="" tabindex="200" />&nbsp;
					<button onclick="relatekw();return false">{lang searchtags}</button><span id="tagselect"></span>
					<em class="tips">{lang tag_comment}</em>
				</td>
			</tr>
		<!--{/if}-->

		<!--{if $special == 5}-->
			<tr>
			<th><label class="affirmpoint">{lang debate_square_point}</label></th>
			<td><textarea name="affirmpoint" id="affirmpoint" rows="10" cols="20" style="width:99%; height:60px" tabindex="201" onkeydown="ctlent(event)"></textarea></td>
			</tr>
			<tr>
			<th><label class="negapoint">{lang debate_opponent_point}</label></th>
			<td><textarea name="negapoint" id="negapoint" rows="10" cols="20" style="width:99%; height:60px" tabindex="202" onkeydown="ctlent(event)"></textarea></td>
			</tr>
		<!--{/if}-->

		<thead>
			<tr>
				<th>&nbsp;</th>
				<td><label><input id="advshow" class="checkbox" type="checkbox" onclick="showadv()" tabindex="203" />{lang post_otherinfo}</label></td>
			</tr>
		</thead>
		<tbody id="adv" style="display: none">

			<!--{if $special == 5}-->
				<tr>
				<th><label for="endtime">{lang debate_endtime}</label></th>
				<td><input onclick="showcalendar(event, this, true)" type="text" name="endtime" size="45" value="" tabindex="204" /></td>
				</tr>
				<tr>
				<th><label for="umpire">{lang debate_umpire}</label></th>
				<td><input type="text" name="umpire" id="umpire" size="45" tabindex="205" onblur="checkuserexists(this.value, 'checkuserinfo')" value="$discuz_user" />
					<span id="checkuserinfo"></span></td>
				</tr>
			<!--{/if}-->

			<!--{if $allowsetreadperm}-->
				<tr>
					<th><label for="readperm">{lang readperm_thread}</label></th>
					<td><input type="text" name="readperm" id="readperm" size="6" value="$readperm" tabindex="206" /> <em class="tips">({lang post_zero_is_nopermission})</em></td>
				</tr>
			<!--{/if}-->

			<!--{if $maxprice && !$special}-->
				<tr>
					<th><label for="price">{lang price}({$extcredits[$creditstrans][title]})</label></th>
					<td><input type="text" name="price" id="price" size="6" value="$price" tabindex="207" /> <em class="tips">{$extcredits[$creditstrans][unit]}
						({lang post_price_comment}
						<!--{if $maxincperthread}-->{lang post_price_income_comment}<!--{/if}-->
						<!--{if $maxchargespan}-->{lang post_price_charge_comment}<!--{/if}-->)
					{lang post_price_free_comment}</em>
				</td>
				</tr>
			<!--{/if}-->

			<!--{if !$special}-->
				<tr>
					<th>{lang icon}</th>
					<td><label><input class="radio" type="radio" name="iconid" value="0" checked="checked" tabindex="208" /> {lang none}</label> $icons</td>
				</tr>
			<!--{/if}-->

			</tbody>
			<tr class="btns">
				<th>&nbsp;</th>
				<td>
					<input type="hidden" name="wysiwyg" id="{$editorid}_mode" value="$editormode" />
					<button type="submit" name="topicsubmit" id="postsubmit" value="true" tabindex="300">
						<!--{if $special == 1}-->{lang post_newthread_poll}<!--{elseif $special == 3}-->{lang post_newthread_reward}<!--{elseif $special == 5}-->{lang post_newthread_debate}<!--{else}-->{lang post_newthread}<!--{/if}--></button>
					<em>{lang post_submit_hotkey}</em>&nbsp;&nbsp;
					&nbsp;<a href="###" id="restoredata" onclick="loadData()" title="{lang post_autosave_last_restore}">{lang post_autosave_restore}</a>
				</td>
			</tr>
		</table>
	</div>
<br />

</form>

<script type="text/javascript">
	function showadv() {
		if($("advshow").checked == true) {
			$("adv").style.display = "";
		} else {
			$("adv").style.display = "none";
		}
	}
	function checkuserexists(username, objname) {
		var x = new Ajax();
		username = is_ie && document.charset == 'utf-8' ? encodeURIComponent(username) : username;
		x.get('ajax.php?inajax=1&action=checkuserexists&username=' + username, function(s){
			var obj = $(objname);
			obj.innerHTML = s;
		});
	}
	<!--{if $typeid}-->ajaxget('post.php?action=threadtypes&typeid=$typeid&fid=$fid&inajax=1', 'threadtypes', 'threadtypeswait');<!--{/if}-->
</script>

{template post_js}

<!--{if !$iscircle || !$sgid}-->{template footer}<!--{else}-->{template supesite_footer}<!--{/if}-->